package cc.wsyw126.java.nowcoder.sword_offer;

/**
 * Created by Administrator on 2017/4/17.
 * 写一个函数，求两个整数之和，要求在函数体内不得使用+、-、*、/四则运算符号。
 */
public class Add_Solution {
    public int Add(int num1,int num2) {
        do {
            int sum = num1 ^ num2;
            num2 = (num1 & num2) << 1;
            num1=sum;
        }while (num2!=0);
        return num1;
    }

    public static void main(String[] args) {
        Add_Solution add_solution = new Add_Solution();
        int add = add_solution.Add(111, 899);
        System.out.println(add);
    }
}
